﻿using CleanArchitecture.Core.Configuration;
using System.Collections.Generic;

namespace CleanArchitecture.Web.Backend.BackendApi
{
    public class LoginResultMsg
    {
        private readonly IDictionary<LoginResults, string> MsgDic = new Dictionary<LoginResults, string>()
        {
            { LoginResults.Successful, ApiResponseMessages.LoginResultsSuccessful },
            { LoginResults.UserNotExist, ApiResponseMessages.LoginResultsUserNotExist },
            { LoginResults.WrongPassword, ApiResponseMessages.LoginResultsWrongPassword },
            { LoginResults.NotActive, ApiResponseMessages.LoginResultsNotActive },
            { LoginResults.Deleted, ApiResponseMessages.LoginResultsDeleted },
            { LoginResults.NotRegistered, ApiResponseMessages.LoginResultsNotRegistered },
            { LoginResults.LockedOut, ApiResponseMessages.LoginResultsLockedOut },
        };

        public string this[LoginResults results]
        {
            // returns value if exists
            get { return MsgDic[results]; }
        }
    }
    public static class ApiResponseMessages
    {
        public const string ArgumentCannotBeNull = "提交数据不能为空，请检查后重新提交";
        public const string ModelBindingError = "提交后台数据错误";
        public const string AdminUserNotExsitsError = "系统未找到指定用户";
        public const string AdminRoleNotExsitsError = "系统未找到指定用户角色";
        public const string PermissionNotAuthorize = "系统拒绝了服务请求：用户没有此权限";
        public const string ColumnButtonNotAuthorize = "您没有文章编辑的权限";
        public const string AdminUserPassworkExpired = "您的账号密码已过期，存在不安全隐患，请尽快更换";
        public const string UpdateSuccessAndRefreshCache = "数据更新成功，并清理系统缓存，页面将重载更新数据";
        public const string EntityNotFound = "系统未找到指定数据，操作取消";
        public const string DeleteNodeHasChildNodes = "该节点下还有子节点存在，请先删除其子节点";
        public const string ParentNodeCannotbeIteself = "树结构父节点不能与本节点相同,请重新选择父节点";
        public const string OrganizeIdExsitsInRoleModel = "有系统用户角色关联了待删除的组织机构，请先更新用户角色所属组织机构";
        public const string UpdateSuccess = "操作成功";
        public const string MaxLimit = "{0} 长度超过限定长度{1}";
        public const string SDKCallError = "SDK调用出错，请联系系统管理员";
        public const string BugReport = "Bug Report: {0}";
        public const string DisplayOrderSetSuccess = "排序号设置成功";

        #region ApiSystemNotice
        public const string NoticeTitleLimit = "通知消息标题太长，请整理后再发布";
        public const string NoticeTextLimit = "通知消息内容超过系统限制，请精简后再发布";
        #endregion

        #region NoticeHub
        public const string NewNoticeAdded = "系统管理员发布了新的通知消息，请注意查看";
        #endregion

        #region ApiBackendAccountSetting
        public const string ErrorPasswordForChange = "修改密码不成功，原密码验证不符";
        public const string AccountSettingSuccess = "账号设置成功，新设置将在下次登录启用";
        public const string AccountSettingSuccessConfirm = "账号设置成功，是否返回列表?";
        public const string NewRegisterAccountSuccess = "新账号注册成功，请尽快登录修改账户密码";
        public const string AccountSettingSuccessReLogin = "账号安全设置成功，请重新登录账号";
        public const string AccountPasswordStrongWeak = "账户密码强度：低";
        public const string AccountPasswordStrongMedium = "账户密码强度: 中";
        public const string AccountPasswordStrongStrong = "账户密码强度：高";
        public const string AccountNotUniqueError = "账号:{0} 已存在，请更换确保登录账号唯一性";
        public const string AccountNotAssignRoleError = "用户未分配任何角色";
        public const string CannotDeleteSelfAccount = "删除账号与当前登录账号一致，无法删除";
        public const string NewRegisterAccountNotActive = "新注册用户状态不能为锁定";
        public const string NewRegisterAccountPasswordNotNull = "新注册用户密码不能为空";
        public const string SystemAdminRoleCannotDelete = "系统管理员不能删除";
        public const string UserHasOnlyOneRole = "用户角色不能被删除：有用户只唯一匹配该角色";
        public const string AvatarUploadSuccess = "头像设置成功，新头像将在下次登录时显示";
        #endregion

        #region ApiBackendLogin
        public const string CaptchaCodeError = "验证码输入错误！";
        public const string LoginResultsSuccessful = "登录成功，正在加载首页...";
        public const string LoginResultsUserNotExist = "登录账号不存在！";
        public const string LoginResultsWrongPassword = "登录账号密码错误，请重试！";
        public const string LoginResultsNotActive = "登录账号未激活，或被锁定限制登录，请联系系统管理员！";
        public const string LoginResultsDeleted = "登录账号已被注销，请联系系统管理员！";
        public const string LoginResultsNotRegistered = "登录账号未激活，或未注册，请联系系统管理员! ";
        public const string LoginResultsLockedOut = "登录账号未激活，或被锁定限制登录，请联系系统管理员！";
        public const string LogoutSuccessful = "退出成功，祝您生活愉快！";
        #endregion

        #region ApiBackendSystemModule
        public const string RootNodeCannotChange = "模块根节点不允许更改使用属性,添加或删除";
        public const string UrlNotNullWhenModulePage = "当模块类型为'系统模块时',Url地址不能为空";
        public const string UrlNotCorrect = "Url地址不符合规范";
        public const string EnsureUrlUnique = "系统模块Url地址已经存在，请保证Url地址的唯一性";
        public const string ModulePageCanntbeParent = "指定父节点为'系统模块',不能做为父级";
        public const string CancelModuleEdit = "有系统按钮已被授权用户角色，请在权限管理中先取消系统模块按钮授权";
        public const string OrganizeNotExists = "组织机构不存在";
        #endregion

        #region ApiColumnManage
        public const string ColumnUpdateSeccess = "菜单更新成功";
        public const string ColumnAssigntoParent = "栏目菜单父级挂载错误";
        public const string ColumnImageUploadSuccess = "图片上传成功，栏目菜单编辑提交后保存";
        public const string NoColumnsFoundForLanguage = "指定语言下栏目菜单为空，请先创建对应语言的菜单栏目";
        #endregion

        #region ApiNewsItem
        public const string RecommendCloudUpload = "上传文件超过系统限制，请使用云存储上传";
        public const string FileNotFound = "下载资源不存在";
        public const string FileUploadNotSupport = "系统暂不支持该文件类型上传存储";
        public const string FileDeleteSuccess = "图片或文件已从服务器删除";
        public const string NewsSettingsNotAllowComments = "系统设定已禁止所有文章留言，如需要开启，请前往系统设置进行配置。";
        public const string FileUploadSuccess = "上传成功，将在文章编辑提交后保存";
        public const string NewsSettingsNotEnabled = "系统设定已关闭新闻/文章模块，如需要开启，请前往系统设置进行配置。";
        public const string NewsDeleteCount = "成功删除记录{0}条";
        public const string BlogDeleteCount = "成功删除博文{0}条";
        public const string ApiResponseError = "获取数据出错，请联系系统管理员";
        public const string OnlyMeCanHandle = "该新闻/文章为其他用户私密浏览，您无权限操作";
        public const string NewsUpdateSuccess = "新闻/文章编辑提交成功";
        public const string BlogUpdateSuccess = "博客文章编辑提交成功";
        #endregion

        #region ApiResourceManage
        public const string NoResourceSelectForUpload = "请选择要上传保存的文件";
        public const string CloudUploadNotSupport = "云存储功能还未开通服务权限";
        public const string ResourceUploadSuccess = "上传成功，您可以继续上传或关闭窗口";
        public const string ResourceEditSuccess = "资源文件信息编辑成功。";
        public const string ResourceDeleteSuccess = "资源文件已从服务器删除";
        #endregion

        #region ApiAdvertise
        public const string StartOrEndTimeCannotNull = "请选择广告投放时间，全选或不选";
        public const string StartTimeLaterthanEndTime = "广告投放开始时间不应晚于结束时间";
        public const string AdvertiseEditSuccess = "广告栏编辑成功。";
        #endregion

        #region ApiCommentManage
        public const string SystemCommentResponseSuccess = "系统留言回复成功";
        public const string SystemCommentDeleteSuccess = "系统留言及留言回复删除成功";
        #endregion

        #region ApiWebsiteManage
        public const string SettingImageUploadSuccess = "图片上传成功，站点编辑提交后保存";
        public const string SettingEditSuccess = "客户端设置成功";
        #endregion
    }
}
